package com.qf.exhandler;

import com.qf.vo.ResultVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice  // 全局异常处理器
public class GlobalExHandler {

    @ExceptionHandler(Exception.class)
    public ResultVo handleEx(Exception e){
        e.printStackTrace();
        return new ResultVo(-1, e.getMessage(), null);

    }
}
